const Router = require('koa-router'),
	feedback = require('../models/feedback_mod'),
	//jwt = require('jsonwebtoken'),
	//{JWT_KEY} = require('../lib/constant.js'),
	//_ = require('lodash'),
	image = require('../models/image_mod'),
	router = new Router;
router.prefix('/api/feedback');

router.post('/', async (ctx, next) => {
	let { user_id, business_id, feedback_context } = ctx.request.body;
	let res = await feedback.Feedback(user_id, business_id, feedback_context);
	ctx.body = res;
})
router.get('/', async (ctx, next) => {
	let res = await feedback.Feedback_look();
	ctx.body = res;
})
router.delete('/', async (ctx, next) => {
	let { feedback_id } = ctx.request.body;
	let res = await feedback.Feedback_delete(feedback_id);
	ctx.body = res;
})
module.exports = router;
